package com.lhc.bean.postprocessorinterface;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.stereotype.Component;

/**
 * @author LuHuanCheng
 * 类说明：在refresh的registy
 */
@Component
public class CustomerBeanPostProcessor implements BeanPostProcessor {
    @Override
    public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
        if (bean instanceof CustomerBeanPostProcessor) {
            System.out.println("类CustomerBeanPostProcessor的方法postProcessBeforeInitialization");
        }
        return null;
    }

    @Override
    public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
        if (bean instanceof CustomerBeanPostProcessor) {
            System.out.println("类CustomerBeanPostProcessor的方法postProcessAfterInitialization");
        }
        return null;
    }
}